﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using System.Windows.Controls;

namespace Randomizer
{
    class GeneratedItems : INotifyPropertyChanged 
    {
        private string name;
        private string weight;
        private string cost;
        private string book;

        public event PropertyChangedEventHandler PropertyChanged;

        public GeneratedItems(string name, string weight, string cost, string book)
        {
            this.name = name;
            this.weight = weight;
            this.cost = cost;
            this.book = book;
        }

        public string Name
        {
            get { return name; }
            set 
            { 
                name = value;
                this.NotifyPropertyChanged("Name");
            }
        }

        public string Weight
        {
            get { return weight; }
            set 
            { 
                weight = value;
                this.NotifyPropertyChanged("Weight");
            }
        }

        public string Cost
        {
            get { return cost; }
            set 
            {
                cost = value;
                this.NotifyPropertyChanged("Cost");
            }
        }

        public string Book
        {
            get { return book; }
            set 
            { 
                book = value;
                this.NotifyPropertyChanged("Index");
            }
        }

        private void NotifyPropertyChanged(string name)
        {
            if (PropertyChanged != null)
                PropertyChanged(this, new PropertyChangedEventArgs(name));
        } 
    }
}
